package cn.initcap.designpattern.pattern.structural.proxy;

/**
 * @author initcap
 * @date Created in 2018/9/18 AM8:32.
 */
public class OrderServiceImpl implements IOrderService {

    private IOrderDao iOrderDao;

    @Override
    public int saveOrder(Order order) {
        // Spring会自己注入，这里就直接new了
        iOrderDao = new OrderDaoImpl();
        System.out.println("Service层调用Dao层添加Order");
        return iOrderDao.insert(order);
    }

}
